package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 核销方式(1-线上核销，2-线下核销)
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum VerifyMethodEnum {

    ON_LINE(1, "线上核销"),
    OFF_LINE(2, "线下核销"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    VerifyMethodEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static VerifyMethodEnum typeOf(Integer value) {
        VerifyMethodEnum[] values = VerifyMethodEnum.values();
        for (VerifyMethodEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static VerifyMethodEnum typeOf(String name) {
        VerifyMethodEnum[] values = VerifyMethodEnum.values();
        for (VerifyMethodEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
